<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <meta name="renderer" content="webkit" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <title>50bus-剧本</title>
    <meta name="keywords" content="50bus" />
    <meta name="copyright" content="50bus.cn" />
    <!-- <meta http-equiv="mobile-agent" content="http://www.50bus.cn/" />
    <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" /> -->
    <link rel="icon" href="/resources/img/favicon.ico" type="image/x-icon" />
    
    <link rel="stylesheet" type="text/css" href="/resources/css/base.css" media="all" />
    <link rel="stylesheet" type="text/css" href="/resources/css/globe.css" media="all" />
    <link rel="stylesheet" type="text/css" href="/resources/css/module-script.css" media="all" />
    <link rel="stylesheet" type="text/css" href="/resources/css/page.css" media="all" />
    <script type="text/javascript" src="/resources/js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="/resources/js/jquery.pagination.js"></script>
</head>

<body>
    <div class="header_wrap">
        <div class="header clearfix">
            <div class="fm980 fl clearfix">
                <a href="/index.html" class="logo fl"></a>
                <ul class="nav_box fl">
                   <li><a href="/creative_list.html">形象创意</a></li>
                    <li><a href="/script_list.html" class="cur" >剧本创作</a></li>
                    <li><a href="/render_index.html">动画渲染</a></li>
                    <li><a href="/creative_helper.html">创意助手</a></li>
                </ul>
                <div class="about_box fr">
                    <a href="/about.html">关于我们</a>
                    <#if uid??&&uid!="">
	                    <a href="/user/user_work.html">个人空间</a>
	                    <a href="/logout.html">退出</a>
                    <#else>
	                    <a href="/register.html">注册</a>
	                    <a href="/login.html">登录</a>
                    </#if>
                </div>
            </div>
        </div>

    </div>

    <div class="body_wrap">
        <div class="box_2">
            <div class="fm980">
                <div class="box_hd"><a href="/script_list.html">剧本创作</a> &gt; ${scriptModel.script_title}</div>
                <div class="box_bd clearfix">
                    <div class="script_list_left fl">
                        <!-- 剧情简介 -->
                        <div class="script_intro clearfix">
                            <div class="script_cover fl"><#if scriptModel.s_cover??&&scriptModel.s_cover!=""><img style="width:96px;height:140px;" src=${scriptModel.s_cover} /><#else><img src="/resources/img/script_def_90x134.png"></#if></div>
                            <div class="script_info">
                              <#if uid??&&uid=scriptModel.uid&&scriptModel.end_time?datetime("yyyy-MM-dd")gt(.now)>
                                <a class="btn_oper_purple mt10 fr" href="/script_collect_editor.html?sid=${scriptModel.sid}">编辑</a>
                              <#else>
                                <a style="display:none;" class="btn_oper_purple mt10 fr" href="javascript:;">编辑</a>
                              </#if>
                                <h3 class="script_t">${scriptModel.script_title}</h3>
                                <p>剧本类型：<span class="purple_txt">${scriptModel.collect_type}</span></p>
                                <p>剧本题材：<span class="purple_txt">${scriptModel.theme}</span></p>
                                <p>截稿时间：${scriptModel.end_time}</p>
                                <#if ((scriptModel.end_time?datetime("yyyy-MM-dd")) gt (.now)) && scriptModel.uid != uid>
                                	<a href="script_want_collect.html?sid=${scriptModel.sid}" class="btn_com_red mt20 mb10"><span>￥${scriptModel.collect_budget?string("0.##")}</span>我要投稿</a>
                                <#else>
                                	<p>投票截止时间：${scriptModel.vote_end_time}</p>
                                </#if>
                                <p>投稿参与人数：${attributeCount}人</p>
                            </div>
                        </div>
                        <!-- 剧情摘要 -->
                        <div class="script_digest script_desc">
                            <span>剧情摘要：</span>
                            <#if scriptModel.script_demand?length gt 150 >${scriptModel.script_demand?substring(0,150)}...<a href="javascript:void(0);" class="purple_txt u_line script_down">展开</a><#else>${scriptModel.script_demand}</#if>
                        </div>
                        <div class="script_digest script_detail" style="display:none">
                            <span>剧情摘要：</span>
                            ${scriptModel.script_demand}<a href="javascript:void(0);" class="purple_txt u_line script_up">收起</a>
                        </div>
                        <!-- 全部投稿剧集 -->
                        <div class="script_tab_box">
                            <div class="script_tab_t clearfix">
                                <span class="fl">全部投稿剧集</span>
                                <ul style="display:none" class="fr">
                                    <li><a href="javascirpt:;">第三季</a></li>
                                    <li><a href="javascirpt:;" class="cur">第二季</a></li>
                                    <li><a href="javascirpt:;">第一季</a></li>
                                </ul>
                            </div>
                            <div class="script_tab_item">
                            	<#if !first_page_attributelist?? || (first_page_attributelist?size lte 0)>
	                            	<p class="script_no_con fz16">
					                                    感谢对本剧本的关注<br>
					                                    还未收到投稿<#if scriptModel.uid!=uid>，欢迎<a class="purple_txt u_line " href="/script_want_collect.html?sid=${scriptModel.sid}">参与投稿！</a></#if> 
	                                </p>
	                            <#else>
	                                <ul>
	                                   <#assign index = 0>
	                                  <#list first_page_attributelist as attribute>
	                                   	<li class="clearfix">
	                                   		<#assign index = index + 1>
	                                   		<#if (scriptModel.vote_end_time?datetime("yyyy-MM-dd")) lte (.now) >
	                                        	<b class="script_no script_no${index}"></b>
	                                        </#if>
	                                        <!-- 用户名称 -->
	                                        <div class="user_name fl clearfix" >
	                                        	<#if attribute.header_img?? && attribute.header_img!=''>
	                                        		<img class="r10 fl" style="width:20px;height:20px;" src="${attribute.header_img}" />
	                                        	<#else>
	                                        		<img class="r10 fl" style="width:20px;height:20px;" src="/resources/img/user_def_70.png" />
	                                        	</#if>
	                                        </div>
	                                        <div class="script_con">
	                                            <h4> <a href="javascript:void(0);" class="fr"></a><a href="/script_contribute_list.html?sid=${attribute.sid}&own_sid=${attribute.own_sid}&attribute_uid=${attribute.uid}">${attribute.script_title_own}</a></h4>
	                                            <p><#if attribute.essential?length gt 112 >${attribute.essential?substring(0,112)}...<#else>${attribute.essential}</#if>
	                                            <div class="time_box clearfix">
	                                                <span class="fr like_box_14 liked_box_14">
	                                                    ${attribute.addlike}
	                                                    <a class="fav_heart" href="/script_contribute_list.html?sid=${attribute.sid}&own_sid=${attribute.own_sid}&attribute_uid=${attribute.uid}"></a>
	                                                </span>
	                                                ${attribute.create_time?datetime("yyyy-MM-dd")?date}
	                                                <span class="ml20">阅读人数：${attribute.view_count}人</span>
	                                             </div>
	                                        </div>
	                                    </li>
	                                  </#list>  
	                                </ul>
	                               </#if>
                                <div id="Pagination" class="page_box mb40"></div>
                            </div>
                        </div>
                    </div>
                    <div class="script_link_box fr">
                        <div class="comp_logo">
                            <#if userModel.header_img??&&userModel.header_img!=''>
                            	<span style="padding:0px;" class="comp_logo_box fl"><img style="width:52px;height:52px;" src="${userModel.header_img}"></span>
                            <#else>
                            	<span style="padding:0px;" class="comp_logo_box fl"><img  src="/resources/img/eg_comp_logo_50.png"></span>
                            </#if>
                            <p>${comp}</p>
                        </div>
                        <div class="script_intro_link">
                            <p class="fz16">全部剧集<span class="purple_txt">（${script_count}）</span></p>
                            <ul>
                              <#list scriptList as script>
                                <li class="script_intro_item clearfix">
                                    <div class="script_cover fl">
                                    	<a href="/script_collect_detail.html?sid=${script.sid}"><#if script.s_cover??&&script.s_cover!=""><img style="width:96px;height:140px;" src="${script.s_cover}" /><#else><img  src="/resources/img/script_def_90x134.png"></#if></a>
                                    </div>
                                    <div class="script_intro_info">
                                        <p class="t purple_txt"><a href="/script_collect_detail.html?sid=${script.sid}">${script.script_title} </a></p>
                                        <p><label>发起方：</label><br>${comp}</p>
                                        <p><label>剧情摘要：</label><br><#if script.script_demand?length gt 20>${script.script_demand?substring(0,20)}...<#else>${script.script_demand}</#if></p>
                                    </div>
                                </li>
                              </#list>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
   <div class="footer">
        <div class="fm980 clearfix">
            <div class="foot_link foot_link1 fl">
                <a href="/creative_list.html">形象创意</a>
                <a href="/script_list.html">剧本创作</a>
                <a href="/render_index.html">动画渲染</a>
                <a href="/creative_helper.html" >创意助手</a>
            </div>
            <div class="foot_link foot_link2 fl">
                <a href="http://zjusp.zju.edu.cn/">浙大科技园</a>
                <a href="http://www.zju.edu.cn/">浙江大学</a>
                <a href="/about.html" >关于我们</a>
            </div>
            <div class="copy_box fr">
                <img class="mb5" src="/resources/img/foot_text.png" />
                <p>&copy; 2013-2016 All right reserved</p>
                <p><a href="">服务条款</a><a href="">隐私条款</a><a href="">法律条款</a></p>
                <p style="display:none;"><a href="" class="share_icon share_sina"></a><a href="" class="share_icon share_wx"></a></p>
            </div>
        </div>
    </div>
<script type="text/javascript">
$(function(){
	var initPagination = function() {
		$("#Pagination").pagination(${attributeCount}, {
			num_edge_entries: 3, //边缘页数
			num_display_entries: 2, //主体页数
			callback: pageselectCallback,
			items_per_page:5, //每页显示创意数量
			current_page:0,
			prev_text:"<",
			next_text:">",
			ellipse_text:"...",
			prev_show_always:true,
			next_show_always:true
		});
	 }();
	function pageselectCallback(current_page, panel){
		ajaxGetAtt(current_page+1);
		//location.href = "/script_collect_detail.html?sid=${scriptModel.sid}&pageIndex="+(current_page+1);
	}
	
	$(".script_down").click(function(){
		//展开
		$(".script_desc").toggle();
		$(".script_detail").toggle();
	});
	
	$(".script_up").click(function(){
		//收起
		$(".script_detail").toggle();
		$(".script_desc").toggle();
	});
	
	function ajaxGetAtt(pageIndex){
		$.ajax({
			type : "POST",
			data : {pageIndex : pageIndex,sid : ${scriptModel.sid}},
			dataType : "json",
			url : "attributelist.json",
			success : function(data){
				if(data.success == "true"){
					$(".script_tab_item ul").empty();
					$.each(data.data,function(index,content){
						var html = "";
						html += '<li class="clearfix">';
						if(pageIndex == 1){
							html += '	 <b class="script_no script_no'+(index+1)+'"></b>';
						}
                        html += '    <div class="user_name fl clearfix">';
                        if(content.header_img != null && content.header_img != '')
                        	html += '        <img class="r10 fl" src="'+content.header_img+'" />';
                        else
                        	html += '        <img class="r10 fl" src="/resources/img/eg_user_img.png" />';
                        html += '    </div>';
                        html += '    <div class="script_con">';
                        html += '        <h4> <a href="javascript:;" class=" fr"></a><a href="/script_contribute_list.html?sid='+content.sid+'&own_sid='+content.own_sid+'&attribute_uid='+content.uid+'">'+content.script_title_own+'</a></h4>';
                        html += '        <p>'+content.essential+'</p>';
                        html += '        <div class="time_box clearfix">';
                        html += '            <span class="fr like_box_14 liked_box_14">';
                        html += '                '+content.addlike+' ';
                        html += '                <a class="fav_heart" href="/script_contribute_list.html?sid='+content.sid+'&own_sid='+content.own_sid+'&attribute_uid='+content.uid+'"></a>';
                        html += '            </span>';
                        html += '            '+content.create_time.substr(0,10)+'';
                        html += '            <span class="ml20">阅读人数：'+content.view_count+'人</span>';
                        html += '         </div>';
                        html += '    </div>';
                        html += '</li>';
                        $(".script_tab_item ul").append(html);
                        html = "";
					});
				}
			},
			error: function() {
	        	parent.hideLazyBox();
	        	var userFunc = undef(cfg.error,function(){parent.showMessage("alert-danger","请求失败");});
	        	userFunc();
			}
		});
	}
	
	function ajaxGetScript(uid){
		$.ajax({
			type : "POST",
			data : {uid : uid},
			dataType : "json",
			url : "attributelist.json",
			success : function(data){
				if(data.success == "true"){
					$(".script_tab_item ul").empty();
					$.each(data.data,function(index,content){
						var html = "";
						html += '<li class="clearfix">';
                        html += '    <div class="user_name fl clearfix">';
                        html += '        <img class="r10 fl" src="../img/eg_user_img.png" />';
                        html += '    </div>';
                        html += '    <div class="script_con">';
                        html += '        <h4> <a href="javascript:;" class="icon_more fr"></a>'+content.script_title_own+'</h4>';
                        html += '        <p>'+content.essential+'</p>';
                        html += '        <div class="time_box clearfix">';
                        html += '            <span class="fr like_box_14">';
                        html += '                '+content.addlike+' ';
                        html += '                <a class="fav_heart" href="javascript:;"></a>';
                        html += '            </span>';
                        html += '            '+content.create_time.substr(0,10)+'';
                        html += '            <span class="ml20">阅读人数：2456123人</span>';
                        html += '         </div>';
                        html += '    </div>';
                        html += '</li>';
                        $(".script_tab_item ul").append(html);
                        html = "";
					});
				}
			},
			error: function() {
	        	parent.hideLazyBox();
	        	var userFunc = undef(cfg.error,function(){parent.showMessage("alert-danger","请求失败");});
	        	userFunc();
			}
		});
	}
	
	initPagination();
});
</script>
<script type="text/javascript" src="/resources/js/page-index.js"></script>
<script type="text/javascript">
	<#if uid??&&uid!="">
    	$.post("/common/getUserName.json",{"uid":${uid}},function(data){
    		if(data.name){
    			$('a[href="/user/user_work.html"]').html(data.name+"个人空间");
    		}
    	});
	 </#if>
	 
</script>
</body>
</html>